



/* Long-run event study graphs */



clear all


use "G:\Data\Workdata\707677\Common\01Data\02STATA\panel.dta"

cd "G:\Data\Workdata\707677\FKYY7677\Debt_relief\Statafiles\Outputs\Revision\FINAL"



sort pnr aar

destring pnr, replace

xtset pnr aar


/* Local macro for selection of observations */


local selection "time>-5 & time<17 & sumpre>0 & sumpost>0"




/* Create covariates for regressions */


gen age2=age*age


tab aar, gen(yeardum)											/* Year dummies */

tab time if (time>-5 & time<17), gen(timedum)					/* Time dummies */





/* Create variables for difference-in-difference setup */


gen treated=granted

gen after=0

replace after=1 if time>0

gen interaction=treated*after




foreach i of num 1/21 {											/* Time dummies intearacted with treatment */
	
gen interaction`i'=timedum`i'*treated	
	
	
}




/**************************************************/
/*                                                */
/* REGRESSION WITH TIME-VARYING TREATMENT EFFECTS */
/*                                                */
/**************************************************/



/* Earned Income */



local depvar1 "erhvervsindk_real"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0



xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21 yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe


#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")


xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))


ylabel(0 "0" 10000 "10" 20000 "20" 30000 "30" 40000 "40",nogrid angle(0) labsize(medsmall))




yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Earned Income", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(earnings, replace)


;


#delimit cr


graph export earnings_event.pdf, replace

graph save earnings_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}










/* Employment */



local depvar1 "employed_pstill"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21 yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe



#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")




xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))


ylabel(0 "0%" 0.025 "2.5%" 0.05 "5.0%" 0.075 "7.5%",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Employment", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(employment, replace)


;


#delimit cr


graph export employment_event.pdf, replace

graph save employment_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}






/* Unemployment */



local depvar1 "unemployed_pstill"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21 yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")



xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))



ylabel(-0.04 "-4%" -0.02 "-2%" 0 "0%" 0.02 "2%",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Unemployment", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(unemployment, replace)


;


#delimit cr


graph export unemployment_event.pdf, replace

graph save unemployment_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}





/* Out of labor force */





local depvar1 "out_of_lf_pstill"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0


xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21 yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")



xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))


ylabel(-0.06 "-6%" -0.04 "-4%" -0.02 "-2%" 0 "0%" 0.02 "2%",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Out of Labor Force", size(medium))

xtitle("Years", size(medsmall))

title("")

graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(outof, replace)

;


#delimit cr


graph export out_of_lf_event.pdf, replace

graph save out_of_lf_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}






/* Hourly Wage */





local depvar1 "timelon_real"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0


xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21  yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")




xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))


ylabel(-5 "-5" 0 "0" 5 "5" 10 "10" 15 "15",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Hourly Wage", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(wage, replace)


;


#delimit cr


graph export timelon_event.pdf, replace

graph save timelon_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}







/* Taxable assets */



local depvar1 "aktiv_real"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0



xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21 yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")




xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))


ylabel(0 "0" 100000 "100" 200000 "200" 300000 "300",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Assets", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(assets, replace)


;


#delimit cr


graph export aktiv_event.pdf, replace

graph save aktiv_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}





/* Taxable Debt */





local depvar1 "passiv_real"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21 yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")




xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))


ylabel(-200000 "-200" -100000 "-100" 0 "0" 100000 "100",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Debt", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(debt, replace)


;


#delimit cr


graph export passiv_event.pdf, replace

graph save passiv_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}





/* Taxable wealth */




local depvar1 "formue_real"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21 yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")



xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))



ylabel(0 "0" 100000 "100" 200000 "200" 300000 "300" 400000 "400",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Wealth", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(wealth, replace)


;


#delimit cr


graph export formue_event.pdf, replace

graph save formue_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}




/* Housing Wealth */



local depvar1 "koejd_real"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0



xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21 yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")



xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))

ylabel(0 "0" 100000 "100" 200000 "200" 300000 "300",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Real Estate", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(realestate, replace)


;


#delimit cr


graph export koejd_event.pdf, replace

graph save koejd_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}






/* Fraction owning house */



local depvar1 "house"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0


xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21 yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")




xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))


ylabel(0 "0" 0.05 "5%" 0.1 "10%" 0.15 "15%" 0.2 "20%" 0.25 "25%" ,nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Real Estate (y/n)", size(medium))

xtitle("Years", size(medium) height(4.5))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(house, replace)

;


#delimit cr


graph export house_event.pdf, replace

graph save house_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}






/* Unsecured debt */



local depvar1 "bankgaeld_real"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0



xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21 yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")



xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))

ylabel(0 "0" -100000 "-100" -200000 "-200" -300000 "-300",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Unsecured Debt", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(unsecured, replace)


;


#delimit cr


graph export unsecured_event.pdf, replace

graph save unsecured_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}





/* Secured debt */



local depvar1 "mortgage_real"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>16


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0



xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction21 yeardum2-yeardum33 timedum* if (time>-5 & time<17 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")




xlabel(1 "-4" 2 " " 3 "-2" 4 " " 5 "0" 6 " " 7 "2" 8 " " 9 "4" 10 " " 11 "6" 12 " " 13 "8" 

14 " " 15 "10" 16 " " 17 "12" 18 " " 19 "14" 20 " " 21 "16", angle(0) nogrid labsize(medsmall))

ylabel(0 "0" 100000 "100" 200000 "200" 300000 "300",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Secured Debt", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(secured, replace)


;


#delimit cr


graph export secured_event.pdf, replace

graph save secured_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}





/* Combine */


graph combine earnings employment assets wealth unsecured secured, graphregion(fcolor(white)) scheme(s1color) cols(2) rows(3) imargin(small)

graph save event_panel_1_new, replace

graph export event_panel_1_new.pdf, replace






/* Combine */



graph combine debt house realestate wage outof unemployment, graphregion(fcolor(white)) scheme(s1color) cols(2) rows(3) imargin(small)



graph save event_panel_2_new, replace

graph export event_panel_2_new.pdf, replace


*///////////////////////////
*/ LONGRUN  ////////////////
////////////////////////*/




clear all


use "G:\Data\Workdata\707677\Common\01Data\02STATA\panel", clear 

cd "G:\Data\Workdata\707677\FKYY7677\Debt_relief\Statafiles\Outputs\Revision\FINAL"






sort pnr aar

destring pnr, replace

xtset pnr aar




/* Local macro for selection of observations */


local selection "time>-5 & time<35 & sumpre>0 & sumpost>0"




/* Create covariates for regressions */




tab aar, gen(yeardum)											/* Year dummies */

tab time if (time>-5 & time<35), gen(timedum)					/* Time dummies */



/* Create variables for difference-in-difference setup */


gen treated=granted

gen after=0

replace after=1 if time>0

gen interaction=treated*after





foreach i of num 1/39 {											/* Time dummies intearacted with treatment */
	
gen interaction`i'=timedum`i'*treated	
	
	
}









/**************************************************/
/*                                                */
/* REGRESSION WITH TIME-VARYING TREATMENT EFFECTS */
/*                                                */
/**************************************************/





/* Earned Income */



local depvar1 "erhvervsindk_real"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>34


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0



xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction39 yeardum* timedum* if (time>-5 & time<35 & sumpre>0 & sumpost>0), cluster(pnr) fe


#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30 interaction31 interaction32 interaction33 interaction34 interaction35
interaction36 interaction37 interaction38 interaction39 )

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")




xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 

14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25" 31 " "
32 " " 33 " " 34 " " 35 "30" 36 " " 37 " " 38 " " 39 "34", angle(0) nogrid labsize(medsmall))




ylabel(0 "   0" 10000 "  10" 20000 "  20" 30000 "  30" 40000 "  40",nogrid angle(0) labsize(medsmall))

yscale(titlegap(*-3))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Earned Income", size(medium))

xtitle("Years", size(medsmall))



title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)


name(earnings, replace)


;


#delimit cr


graph export earnings_event_long.pdf, replace

graph save earnings_event_long, replace


drop outcome zero_lead1 pre post sumpre sumpost



}




/* Employment */



local depvar1 "employed_pstill"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>34


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction39 yeardum* timedum* if (time>-5 & time<35 & sumpre>0 & sumpost>0), cluster(pnr) fe



#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30 interaction31 interaction32 interaction33 interaction34 interaction35
interaction36 interaction37 interaction38 interaction39 )

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")





xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 

14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25" 31 " "
32 " " 33 " " 34 " " 35 "30" 36 " " 37 " " 38 " " 39 "34", angle(0) nogrid labsize(medsmall))









ylabel(0 "0%" 0.025 "2.5%" 0.05 "5%" 0.075 "7.5%",nogrid angle(0) labsize(medsmall))

yscale(titlegap(*-3))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Employment", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(employed, replace)


;


#delimit cr


graph export employment_event.pdf, replace

graph save employment_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}





/* Taxable assets */



local depvar1 "aktiv_real "




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>34


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0



xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction39 yeardum* timedum* if (time>-5 & time<35 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30 interaction31 interaction32 interaction33 interaction34 interaction35
interaction36 interaction37 interaction38 interaction39 )

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")




xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 

14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25" 31 " "
32 " " 33 " " 34 " " 35 "30" 36 " " 37 " " 38 " " 39 "34", angle(0) nogrid labsize(medsmall))










ylabel(0 "0" 100000 "100" 200000 "200" 300000 "300" 400000 "400",nogrid angle(0) labsize(medsmall))

yscale(titlegap(*-3))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Assets", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)



name(assets, replace)


;


#delimit cr


graph export aktiv_event.pdf, replace

graph save aktiv_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}







/* Wealth */


local depvar1 "formue_real "




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>34


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction39 yeardum* timedum* if (time>-5 & time<35 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30 interaction31 interaction32 interaction33 interaction34 interaction35
interaction36 interaction37 interaction38 interaction39 )

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")





xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 

14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25" 31 " "
32 " " 33 " " 34 " " 35 "30" 36 " " 37 " " 38 " " 39 "34", angle(0) nogrid labsize(medsmall))


ylabel(0 "0" 100000 "100" 200000 "200" 300000 "300" 400000 "400",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Wealth", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)


name(wealth, replace)

;


#delimit cr


graph export wealth_event_long.pdf, replace

graph save wealth_event_long, replace


drop outcome zero_lead1 pre post sumpre sumpost



}



/* Secured debt */ 




local depvar1 "mortgage_real "




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>34


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction39 yeardum* timedum* if (time>-5 & time<35 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30 interaction31 interaction32 interaction33 interaction34 interaction35
interaction36 interaction37 interaction38 interaction39 )

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")





xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 

14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25" 31 " "
32 " " 33 " " 34 " " 35 "30" 36 " " 37 " " 38 " " 39 "34", angle(0) nogrid labsize(medsmall))




ylabel(-200000 "-200" -100000 "-100" 0 "0" 100000 "100" 200000 "200",nogrid angle(0) labsize(medsmall))

yscale(titlegap(*-3))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Secured Debt", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(secured, replace)


;


#delimit cr


graph export secured_event_long.pdf, replace

graph save secured_event_long, replace


drop outcome zero_lead1 pre post sumpre sumpost



}



/* Unsecured debt */




local depvar1 "bankgaeld_real "




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>30


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction35 yeardum* timedum* if (time>-5 & time<31 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30 interaction31 interaction32 interaction33 interaction34 interaction35
 )

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")






xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 

14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25" 31 " "
32 " " 33 " " 34 " " 35 "30"  , angle(0) nogrid labsize(medsmall))



ylabel(-200000 "-200" -100000 "-100" 0 "0" 100000 "100" 200000 "200",nogrid angle(0) labsize(medsmall))

yscale(titlegap(*-3))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Unsecured Debt", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(unsecured, replace)


;


#delimit cr


graph export unsecured_event_long.pdf, replace

graph save unsecured_event_long, replace


drop outcome zero_lead1 pre post sumpre sumpost



}





/* Combine */



graph combine earnings employed assets wealth unsecured secured, graphregion(fcolor(white)) scheme(s1color) cols(2) rows(3) imargin(small)


graph save event_panel_long_new, replace

graph export event_panel_long_new.pdf, replace





















local depvar1 "passiv_real "




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>25


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction30 yeardum* timedum* if (time>-5 & time<26 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")



xlabel(1 "-4" 2 "-3" 3 "-2" 4 "-1" 5 "0" 6 "1" 7 "2" 8 "3" 9 "4" 10 "5" 11 "6" 12 "7" 13 "8" 

14 "9" 15 "10" 16 "11" 17 "12" 18 "13" 19 "14" 20 "15" 21 "16" 22 "17" 23 "18" 24 "19" 25 "20" 26 "21" 27 "22" 28 "23" 29 "24" 30 "25", angle(0) nogrid labsize(small))

ylabel(-200000 "-200" -100000 "-100" 0 "0" 100000 "100" 200000 "200",nogrid angle(0) labsize(medsmall))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Taxable Debt (1000 DKK)", size(medium))

xtitle("Years since application for debt relief", size(medium) height(4.5))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)


;


#delimit cr


graph export passiv_event.pdf, replace

graph save passiv_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}




/* Out of labor force */





local depvar1 "out_of_lf_pstill"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>25


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0


xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction30 yeardum* timedum* if (time>-5 & time<26 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 



coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")



xlabel(1 "-4" 2 "-3" 3 "-2" 4 "-1" 5 "0" 6 "1" 7 "2" 8 "3" 9 "4" 10 "5" 11 "6" 12 "7" 13 "8" 

14 "9" 15 "10" 16 "11" 17 "12" 18 "13" 19 "14" 20 "15" 21 "16" 22 "17" 23 "18" 24 "19" 25 "20" 26 "21" 27 "22" 28 "23" 29 "24" 30 "25", angle(0) nogrid labsize(small))


ylabel(-0.06 "-6%" -0.04 "-4%" -0.02 "-2%" 0 "0%" 0.02 "2%",nogrid angle(0) labsize(medsmall))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Fraction Out of Labor Force", size(medium))

xtitle("Years since application for debt relief", size(medium) height(4.5))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)


;


#delimit cr


graph export out_of_lf_event.pdf, replace

graph save out_of_lf_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}





/* Fraction owning house */



local depvar1 "house"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>25


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0


xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction30  yeardum* timedum* if (time>-5 & time<26 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")


xlabel(1 "-4" 2 "-3" 3 "-2" 4 "-1" 5 "0" 6 "1" 7 "2" 8 "3" 9 "4" 10 "5" 11 "6" 12 "7" 13 "8" 

14 "9" 15 "10" 16 "11" 17 "12" 18 "13" 19 "14" 20 "15" 21 "16" 22 "17" 23 "18" 24 "19" 25 "20" 26 "21" 27 "22" 28 "23" 29 "24" 30 "25", angle(0) nogrid labsize(small))


ylabel(0 "0" 0.1 "10%" 0.2 "20%" 0.3 "30%",nogrid angle(0) labsize(medsmall))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Fraction Real Estate Owners", size(medium))

xtitle("Years since application for debt relief", size(medium) height(4.5))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)


;


#delimit cr


graph export house_event.pdf, replace

graph save house_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}


* 25 years post window



clear all


use "G:\Data\Workdata\707677\Common\01Data\02STATA\panel_iv_long", clear 





sort pnr aar

destring pnr, replace

xtset pnr aar

keep if pyear<=1994



/* Local macro for selection of observations */


local selection "time>-5 & time<26 & sumpre>0 & sumpost>0"




/* Create covariates for regressions */




tab aar, gen(yeardum)											/* Year dummies */

tab time if (time>-5 & time<26), gen(timedum)					/* Time dummies */



/* Create variables for difference-in-difference setup */


gen treated=granted

gen after=0

replace after=1 if time>0

gen interaction=treated*after





foreach i of num 1/30 {											/* Time dummies intearacted with treatment */
	
gen interaction`i'=timedum`i'*treated	
	
	
}









/**************************************************/
/*                                                */
/* REGRESSION WITH TIME-VARYING TREATMENT EFFECTS */
/*                                                */
/**************************************************/





/* Earned Income */



local depvar1 "erhvervsindk_real"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>25


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0



xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction30  yeardum* timedum* if (time>-5 & time<26 & sumpre>0 & sumpost>0), cluster(pnr) fe


#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  

interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30 )

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")




xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 

14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25", angle(0) nogrid labsize(medsmall))




ylabel(0 "   0" 10000 "  10" 20000 "  20" 30000 "  30" 40000 "  40",nogrid angle(0) labsize(medsmall))

yscale(titlegap(*-3))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Earned Income", size(medium))

xtitle("Years", size(medsmall))



title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)


name(earnings, replace)


;


#delimit cr


graph export earnings_event_long.pdf, replace

graph save earnings_event_long, replace


drop outcome zero_lead1 pre post sumpre sumpost



}




/* Employment */



local depvar1 "employed_pstill"




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>25


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction30  yeardum* timedum* if (time>-5 & time<26 & sumpre>0 & sumpost>0), cluster(pnr) fe



#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")





xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 

14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25", angle(0) nogrid labsize(medsmall))



ylabel(0 "0%" 0.025 "2.5%" 0.05 "5%" 0.075 "7.5%",nogrid angle(0) labsize(medsmall))

yscale(titlegap(*-3))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Employment", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(employed, replace)


;


#delimit cr


graph export employment_event.pdf, replace

graph save employment_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}





/* Taxable assets */



local depvar1 "aktiv_real "




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>25


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0



xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction30  yeardum* timedum* if (time>-5 & time<26 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")






xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 

14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25", angle(0) nogrid labsize(medsmall))






ylabel(0 "0" 100000 "100" 200000 "200" 300000 "300" 400000 "400",nogrid angle(0) labsize(medsmall))

yscale(titlegap(*-3))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Assets", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)



name(assets, replace)


;


#delimit cr


graph export aktiv_event.pdf, replace

graph save aktiv_event, replace


drop outcome zero_lead1 pre post sumpre sumpost



}







/* Wealth */


local depvar1 "formue_real "




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>25


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction30  yeardum* timedum* if (time>-5 & time<26 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")




xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 
14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25", angle(0) nogrid labsize(medsmall))


ylabel(0 "0" 100000 "100" 200000 "200" 300000 "300" 400000 "400",nogrid angle(0) labsize(medsmall))


yscale(titlegap(*-3))


yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Wealth", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)


name(wealth, replace)

;


#delimit cr


graph export wealth_event_long.pdf, replace

graph save wealth_event_long, replace


drop outcome zero_lead1 pre post sumpre sumpost



}



/* Secured debt */ 




local depvar1 "mortgage_real "




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>25


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction30 yeardum* timedum* if (time>-5 & time<26 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")





xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 
14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25", angle(0) nogrid labsize(medsmall))




ylabel(-200000 "-200" -100000 "-100" 0 "0" 100000 "100" 200000 "200",nogrid angle(0) labsize(medsmall))

yscale(titlegap(*-3))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Secured Debt", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(secured, replace)


;


#delimit cr


graph export secured_event_long.pdf, replace

graph save secured_event_long, replace


drop outcome zero_lead1 pre post sumpre sumpost



}



/* Unsecured debt */




local depvar1 "bankgaeld_real "




foreach var of varlist `depvar1'{


gen outcome=`var'


replace outcome=. if time<-4

replace outcome=. if time>25


gen pre=0

gen post=0

replace pre=1 if (outcome~=. & time<1)

replace post=1 if (outcome~=. & time>0)


by pnr: egen sumpre=sum(pre)

by pnr: egen sumpost=sum(post)

gen zero_lead1=0




xtreg outcome interaction1 interaction2 interaction3 zero_lead1 interaction5-interaction30 yeardum* timedum* if (time>-5 & time<26 & sumpre>0 & sumpost>0), cluster(pnr) fe




#delimit ; 


coefplot, omitted vertical keep(interaction1 interaction2 interaction3 zero_lead1  
interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11 interaction12 interaction13 interaction14 interaction15 interaction16 interaction17 interaction18 interaction19 interaction20 interaction21  interaction22  interaction23  interaction24  interaction25  interaction26  interaction27  interaction28  interaction29  interaction30)

mcolor(black)

ciopts(lcolor(black) recast(rcap))

title("`var'")



xlabel(1 "-4" 2 " " 3 " " 4 " " 5 "0" 6 " " 7 " " 8 " " 9 " " 10 "5" 11 " " 12 " " 13 " " 
14 " " 15 "10" 16 " " 17 " " 18 " " 19 " " 20 "15" 21 " " 22 " " 23 " " 24 " " 25 "20" 26 " " 27 " " 28 " " 29 " " 30 "25", angle(0) nogrid labsize(medsmall))


ylabel(-200000 "-200" -100000 "-100" 0 "0" 100000 "100" 200000 "200",nogrid angle(0) labsize(medsmall))

yscale(titlegap(*-3))



yline(0, lcolor(black))

xline(4, lcolor(black) lpattern(dash))

ytitle("Unsecured Debt", size(medium))

xtitle("Years", size(medsmall))

title("")


graphregion(fcolor(white)) bgcolor(white) scheme(s1color)

name(unsecured, replace)


;


#delimit cr


graph export unsecured_event_long.pdf, replace

graph save unsecured_event_long, replace


drop outcome zero_lead1 pre post sumpre sumpost



}





/* Combine */



graph combine earnings employed assets wealth unsecured secured, graphregion(fcolor(white)) scheme(s1color) cols(2) rows(3) imargin(small)


graph save event_panel_long_new, replace

graph export event_panel_long_new.pdf, replace











